<template>
	
	
	
	
	<view >
		 <view >
			 <fui-list-cell  >
			 	<view class="fui-list__item fui-align__center">
					
			 		<fui-input placeholder="请输入手机号" v-model="user.phonenumber">
			 			<template v-slot:left>
			 				<view class="fui-left__icon">
			 					<fui-icon name="mobile"   color="#333" :size="48"></fui-icon>
			 				</view>
			 				
			 				
			 				
			 			</template>
			 		</fui-input>
			 	</view>
			 </fui-list-cell>
		  <fui-button  radius="0"  @click="save()">保存</fui-button>
		
		 </view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				user:{
					userId:"",
					phonenumber:""
				}
			}
		},
		onLoad(e) {
		this.user.userId=e.userId
		},
		methods: {
			save(){
				console.log(this.user)
			if(!this.user.phonenumber){
				
				 
				uni.showToast({
					title: '请输入手机号',
					duration: 2000
				});

				return;
			}
			console.log( this.user)
			this.$request.post('user/wxSaveOrUpdate', this.user).then(res => {
					
				 if(res.code==200){
					 uni.switchTab({
					 	url: '/pages/tabbar/my/my'
					 });

				 }
			
		})
	   }
	}
	
	}
</script>

<style>
.fui-col__item {
		height: 84rpx;
		border-radius: 16rpx;
	}	
	.fui-color__black {
		background-color: white;
	}
</style>
